<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% gcp_service_account_display_name = "#{external_attribute(pwd, 'gcp_service_account_display_name', doc_generation)}" -%>
describe google_service_account(project: <%= gcp_project_id -%>, name: "<%= doc_generation ? "display-name" : "\#{gcp_service_account_display_name}" -%>@<%= doc_generation ? "project-id" : "\#{gcp_project_id}" -%>.iam.gserviceaccount.com") do
  it { should exist }
  its('display_name') { should cmp <%= gcp_service_account_display_name -%> }
end

describe google_service_account(project: <%= gcp_project_id -%>, name: "nonexistent@<%= doc_generation ? "project-id" : "\#{gcp_project_id}" -%>.iam.gserviceaccount.com") do
  it { should_not exist }
end